<!--
 * @author: lhy
-->
<template>
  <div>
    <select v-model="selectType">
      <option :value="1">app订票</option>
      <option :value="0">前台兑换</option>
    </select>
    <ul>
      <li v-for="item in filterCinemaList(selectType)" :key="item.cinemaId">
        {{item.name}}
      </li>
    </ul>
  </div>
</template>

<script>
import {mapActions, mapGetters, mapState} from "vuex";

export default {
  data(){
    return {
      selectType:1
    }
  },
  mounted() {
    // if (this.$store.state.cinemaList.length === 0) {
    if (this.cinemaList.length === 0) {
      // this.$store.dispatch("getCinemaList","参数演示")
      this.getCinemaList("参数演示")
    }else {
    //   走缓存
      console.log("缓存",this.cinemaList.length)
    }
  },
  methods:{
    ...mapActions('CinemaModule',['getCinemaList'])
  },
  computed:{
    ...mapState('CinemaModule',["cinemaList"]),
    ...mapGetters('CinemaModule',['filterCinemaList']),
  }
}
</script>
<style lang="scss">
ul{
  li{
    padding: 10px;
  }
}
</style>